﻿
/*----------------------------------------------------------------//
// 文件名：MoSampleKept.cs
// 文件功能描述：实体 MoSampleKept.
// 
// 创建标识：2009-02-27
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoSampleKept
using System;
using System.Data;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Data.Common;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoSampleKept
	/// </summary>
	public partial class MoSampleKept:ICloneable
	{
		#region 表SampleKept的字段
		private string _sam_kep_id;
		private string _receiver;
		private string _sender;
		private string _sender_tel;
		private string _sender_corp;
		private string _sample_name;
		private string _model;
		private int _qty;
		private string _sample_status;
		private DateTime _receive_date;
		private string _store_addr;
		private string _rem;
		#endregion
		
		#region 构造函数
		public MoSampleKept()
		{
		    
		    
		    
		    
		    
		    
		    
		    
		    
		    _receive_date= DateTime.Now;
		    
		    
		}
		#endregion
		
		#region 拷贝构造函数

		public MoSampleKept(MoSampleKept item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoSampleKept(string sam_kep_id,string receiver,string sender,string sender_tel,string sender_corp,string sample_name,string model,int qty,string sample_status,DateTime receive_date,string store_addr,string rem)
		{
		this._sam_kep_id=sam_kep_id;
		this._receiver=receiver;
		this._sender=sender;
		this._sender_tel=sender_tel;
		this._sender_corp=sender_corp;
		this._sample_name=sample_name;
		this._model=model;
		this._qty=qty;
		this._sample_status=sample_status;
		this._receive_date=receive_date;
		this._store_addr=store_addr;
		this._rem=rem;
		}
		#endregion
		
		#region 表SampleKept的字段属性
		/// <summary>
		/// SAM_KEP_ID
		/// </summary>
		public string Sam_Kep_Id
		{
			get {return _sam_kep_id;}
			set {_sam_kep_id=value;}
		}
		/// <summary>
		/// RECEIVER
		/// </summary>
		public string Receiver
		{
			get {return _receiver;}
			set {_receiver=value;}
		}
		/// <summary>
		/// SENDER
		/// </summary>
		public string Sender
		{
			get {return _sender;}
			set {_sender=value;}
		}
		/// <summary>
		/// SENDER_TEL
		/// </summary>
		public string Sender_Tel
		{
			get {return _sender_tel;}
			set {_sender_tel=value;}
		}
		/// <summary>
		/// SENDER_CORP
		/// </summary>
		public string Sender_Corp
		{
			get {return _sender_corp;}
			set {_sender_corp=value;}
		}
		/// <summary>
		/// SAMPLE_NAME
		/// </summary>
		public string Sample_Name
		{
			get {return _sample_name;}
			set {_sample_name=value;}
		}
		/// <summary>
		/// MODEL
		/// </summary>
		public string Model
		{
			get {return _model;}
			set {_model=value;}
		}
		/// <summary>
		/// QTY
		/// </summary>
		public int Qty
		{
			get {return _qty;}
			set {_qty=value;}
		}
		/// <summary>
		/// SAMPLE_STATUS
		/// </summary>
		public string Sample_Status
		{
			get {return _sample_status;}
			set {_sample_status=value;}
		}
		/// <summary>
		/// RECEIVE_DATE
		/// </summary>
		public DateTime Receive_Date
		{
			get {return _receive_date;}
			set {_receive_date=value;}
		}
		/// <summary>
		/// STORE_ADDR
		/// </summary>
		public string Store_Addr
		{
			get {return _store_addr;}
			set {_store_addr=value;}
		}
		/// <summary>
		/// REM
		/// </summary>
		public string Rem
		{
			get {return _rem;}
			set {_rem=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoSampleKept CopyTo(MoSampleKept item)
        {
		    item.Sam_Kep_Id=this.Sam_Kep_Id;
		    item.Receiver=this.Receiver;
		    item.Sender=this.Sender;
		    item.Sender_Tel=this.Sender_Tel;
		    item.Sender_Corp=this.Sender_Corp;
		    item.Sample_Name=this.Sample_Name;
		    item.Model=this.Model;
		    item.Qty=this.Qty;
		    item.Sample_Status=this.Sample_Status;
		    item.Receive_Date=this.Receive_Date;
		    item.Store_Addr=this.Store_Addr;
		    item.Rem=this.Rem;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoSampleKept NewSampleKept=new MoSampleKept();
		    NewSampleKept._sam_kep_id=this._sam_kep_id;
		    NewSampleKept._receiver=this._receiver;
		    NewSampleKept._sender=this._sender;
		    NewSampleKept._sender_tel=this._sender_tel;
		    NewSampleKept._sender_corp=this._sender_corp;
		    NewSampleKept._sample_name=this._sample_name;
		    NewSampleKept._model=this._model;
		    NewSampleKept._qty=this._qty;
		    NewSampleKept._sample_status=this._sample_status;
		    NewSampleKept._receive_date=this._receive_date;
		    NewSampleKept._store_addr=this._store_addr;
		    NewSampleKept._rem=this._rem;
			return NewSampleKept;
		}
		
		private static MoSampleKept _empty = new MoSampleKept(string.Empty,string.Empty,string.Empty,string.Empty,string.Empty,string.Empty,string.Empty,-1,string.Empty,DateTime.MinValue,string.Empty,string.Empty);
        public static MoSampleKept Empty
        {
            get
            {
                return _empty;
            }
        }
		
		///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {
            if (base.Equals(obj))
            {
                return true;
            }
            else
            {
                MoSampleKept NewSampleKept = obj as MoSampleKept;
                if (NewSampleKept == null)
                {
                    return false;
                }
                else
                {
				if (NewSampleKept.Sam_Kep_Id==this.Sam_Kep_Id && NewSampleKept.Receiver==this.Receiver && NewSampleKept.Sender==this.Sender && NewSampleKept.Sender_Tel==this.Sender_Tel && NewSampleKept.Sender_Corp==this.Sender_Corp && NewSampleKept.Sample_Name==this.Sample_Name && NewSampleKept.Model==this.Model && NewSampleKept.Qty==this.Qty && NewSampleKept.Sample_Status==this.Sample_Status && NewSampleKept.Receive_Date==this.Receive_Date && NewSampleKept.Store_Addr==this.Store_Addr && NewSampleKept.Rem==this.Rem)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format("Sam_Kep_Id={0}/Receiver={1}/Sender={2}/Sender_Tel={3}/Sender_Corp={4}/Sample_Name={5}/Model={6}/Qty={7}/Sample_Status={8}/Receive_Date={9}/Store_Addr={10}/Rem={11}",_sam_kep_id,_receiver,_sender,_sender_tel,_sender_corp,_sample_name,_model,_qty,_sample_status,_receive_date,_store_addr,_rem);
		 
		}
		#endregion
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["Sam_Kep_ID"]!=null && row["Sam_Kep_ID"]!=DBNull.Value)
			{
			    this.Sam_Kep_Id = (string)row["Sam_Kep_ID"];
			}
			else
			{
				this.Sam_Kep_Id =string.Empty;
			}
		    if(row["Receiver"]!=null && row["Receiver"]!=DBNull.Value)
			{
			    this.Receiver = (string)row["Receiver"];
			}
			else
			{
				this.Receiver =string.Empty;
			}
		    if(row["Sender"]!=null && row["Sender"]!=DBNull.Value)
			{
			    this.Sender = (string)row["Sender"];
			}
			else
			{
				this.Sender =string.Empty;
			}
		    if(row["Sender_Tel"]!=null && row["Sender_Tel"]!=DBNull.Value)
			{
			    this.Sender_Tel = (string)row["Sender_Tel"];
			}
			else
			{
				this.Sender_Tel =string.Empty;
			}
		    if(row["Sender_Corp"]!=null && row["Sender_Corp"]!=DBNull.Value)
			{
			    this.Sender_Corp = (string)row["Sender_Corp"];
			}
			else
			{
				this.Sender_Corp =string.Empty;
			}
		    if(row["Sample_Name"]!=null && row["Sample_Name"]!=DBNull.Value)
			{
			    this.Sample_Name = (string)row["Sample_Name"];
			}
			else
			{
				this.Sample_Name =string.Empty;
			}
		    if(row["Model"]!=null && row["Model"]!=DBNull.Value)
			{
			    this.Model = (string)row["Model"];
			}
			else
			{
				this.Model =string.Empty;
			}
		    if(row["QTY"]!=null && row["QTY"]!=DBNull.Value)
			{
			    this.Qty = (int)row["QTY"];
			}
			else
			{
				this.Qty =-1;
			}
		    if(row["Sample_Status"]!=null && row["Sample_Status"]!=DBNull.Value)
			{
			    this.Sample_Status = (string)row["Sample_Status"];
			}
			else
			{
				this.Sample_Status =string.Empty;
			}
		    if(row["Receive_Date"]!=null && row["Receive_Date"]!=DBNull.Value)
			{
			    this.Receive_Date = (DateTime)row["Receive_Date"];
			}
			else
			{
				this.Receive_Date =DateTime.MinValue;
			}
		    if(row["Store_Addr"]!=null && row["Store_Addr"]!=DBNull.Value)
			{
			    this.Store_Addr = (string)row["Store_Addr"];
			}
			else
			{
				this.Store_Addr =string.Empty;
			}
		    if(row["Rem"]!=null && row["Rem"]!=DBNull.Value)
			{
			    this.Rem = (string)row["Rem"];
			}
			else
			{
				this.Rem =string.Empty;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["Sam_Kep_ID"] = this.Sam_Kep_Id;
			row["Receiver"] = this.Receiver;
			row["Sender"] = this.Sender;
			row["Sender_Tel"] = this.Sender_Tel;
			row["Sender_Corp"] = this.Sender_Corp;
			row["Sample_Name"] = this.Sample_Name;
			row["Model"] = this.Model;
			row["QTY"] = this.Qty;
			row["Sample_Status"] = this.Sample_Status;
			row["Receive_Date"] = this.Receive_Date;
			row["Store_Addr"] = this.Store_Addr;
			row["Rem"] = this.Rem;
		}
		#endregion
	}
}
#endregion
